<template>
  <el-dialog :visible.sync="alertImg" title="图片预览" width="70%" center>
    <img class="img" :src="voucherImg" alt="" style="width: 100%;">
  </el-dialog>
</template>

<script>
export default {
  name: "alertImg",
  data() {
    return {
      alertImg: false,
      voucherImg: ''
    };
  },
  mounted() {
    this.$bus.$on("alertImg", config => {
      if (!config) return (this.show = false);
      this.alertImg = true;
      this.voucherImg = `${this.$bus.baseURL}AdminAPI${config.voucherImg}`;
    });
  },
  methods: {
    buttonClick() {
      this.$bus.$emit("alertImg", false);
    }
  }
};
</script>

<style lang="scss">
#alertImg {
}
</style>
